#include "Paragraph.h"
#include "DocStatsInterface.h"
#include "ParagraphVisitor.h"
#include <stdexcept>

void Paragraph::Accept(DocStatsInterface& v)
{
	if(ParagraphVisitor* p = dynamic_cast<ParagraphVisitor*>(&v) )
		p->Visit(*this);
	else
		throw std::runtime_error("Unable to visit Paragraph");
}